Tasks
Tasks are given to faction player to collect items or achieve certain goals. They are given by a Faction Representative
Location
All task files need to be located in the folder data/<modid>/vampirism/tasks/
Id
Every task has an id that is determined by the files' name and directory. E.g., the task in the file data/vampirism/vampirism/tasks/hunter/hunter_lord2.json will have the id vampirism:hunter/hunter_lord2
Schema
{
  "requirements": {
    "requirements": []
  },
  "rewards": {},
  "title": {},
  "description": {},
  "unlocker": []
}
- requirements: The requirements to finish the task.
- rewards: The rewards for finishing the task.
- title: The title of the task. Component
| Field | Type | Description | 
|---|---|---|
| requirements | Requirements | The requirements to finish the task. | 
| rewards | Rewards | The reward for finishing the task. | 
| unlocker | Unlocker | The requirements to accept the task. | 
| title | Component | The title of the task. | 
| description | Component | The description of the task. | 
Requirements
Entity Requirement
This requirement checks if the player has killed a certain amount of a specific entity.
{
  "type": "vampirism:entity",
  "amount": <amount>,
  "description": <description>,
  "entityType": "<entity_type>",
  "id": "<id>"
}
| Field | Type | Description | 
|---|---|---|
| amount | int | the amount of entities that need to be killed | 
| description | Component | the description of the requirement | 
| entity_type | ResourceLocation | id of the entity | 
| id | ResourceLocation | unique id of the requirement inside of the task | 
Entity Type Requirement
This requirement checks if the player has killed a certain amount of entity belonging to an entity tag.
{
  "type": "vampirism:entity_type",
  "amount": <amount>,
  "description": <description>,
  "entityType": "<entity_type>",
  "id": "<id>"
}
| Field | Type | Description | 
|---|---|---|
| amount | int | the amount of entities that need to be killed | 
| description | Component | the description of the requirement | 
| entity_type | ResourceLocation | id of the entity tag | 
| id | ResourceLocation | unique id of the requirement inside of the task | 
Stat Requirement
This requirement checks if a given stat was increased by a defined number.
{
  "type": "vampirism:stat",
  "amount": <amount>,
  "description": <description>,
  "id": "<id>",
  "stat": "<stat>"
}
| Field | Type | Description | 
|---|---|---|
| amount | int | the amount with which the stat need to be increased | 
| description | Component | the description of the requirement | 
| id | ResourceLocation | unique id of the requirement inside of the task | 
| stat | ResourceLocation | the id of the stat that should be checked | 
Item Requirement
This requirement checks if the player has the itemstack in their inventory.
{
  "type": "vampirism:item",
  "description": <description>,
  "id": "<id>",
  "item": <item>
}
| Field | Type | Description | 
|---|---|---|
| description | Component | the description of the requirement | 
| id | ResourceLocation | unique id of the requirement inside of the task | 
| item | Item | the item that should be checked. This includes the amount | 
Boolean Requirement
The Boolean requirement checks a registered funtion, if the requirement is completed. This can only be registered using the api
{
  "type": "vampirism:boolean",
  "description": <description>,
  "id": "<id>",
  "function": "<function>"
}
| Field | Type | Description | 
|---|---|---|
| description | Component | the description of the requirement | 
| id | ResourceLocation | unique id of the requirement inside of the task | 
| function | ResourceLocation | the id of the registered function that should be checked | 
Rewards
Item Reward
A simple item reward that will reward the player with a specific itemstack.
{
  "type": "vampirism:item",
  "item": <item>
}
| Field | Type | Description | 
|---|---|---|
| item | Item | the itemstack that will be rewarded to the player | 
Refinement Item Reward
This is a special item Reward that rewards an accessory item to the player. When a parameter is not given, it will be randomly chosen from the available refinements.
{
  "type": "vampirism:refinement_item",
  "faction": <faction>,
  "item": <item>,
  "rarity": <rarity>
}
| Field | Optional | Type | Description | 
|---|---|---|---|
| faction | x | Faction | the faction for which the accessory should be created | 
| item | x | Item | the accessory item that should be filled with refinements | 
| rarity | x | Rarity | a specific rarity for the refinements. | 
Lord Level Reward
The Lord Level Reward will reward the player with a specific lord level.
{
  "type": "vampirism:lord_level",
  "description": <description>,
  "targetLevel": <targetLevel>
}
| Field | Type | Description | 
|---|---|---|
| description | Component | the description of the requirement | 
| targetLevel | int | the level that should be awarded | 
Action Reward
The action reward will execute a specific registered action upon completion.
{
  "type": "vampirism:consumer",
  "description": <description>,
  "consumer": "<action>"
}
| Field | Type | Description | 
|---|---|---|
| description | Component | the description of the requirement | 
| consumer | ResourceLocation | the id of the registered function that should be executed | 
Unlocker
Level Unlocker
{
  "type": "vampirism:level",
  "reqLevel": <minLevel>,
  "maxLevel": <maxLevel>
}
| Field | Required | Type | Description | 
|---|---|---|---|
| reqLevel | x | int | the minimum level that is required to unlock the task | 
| maxLevel | int | the maximum level that allows this task | 
Lord Level Unlocker
{
  "type": "vampirism:lord_level",
  "exact": true,
  "reqLordLevel": <lord-level>
}
| Field | Required | Type | Description | 
|---|---|---|---|
| exact | x | bool | if the lord level should be exactly the given level | 
| lord-level | x | int | the lord level to unlock this task, or the minium level | 
Parent Unlocker
{
  "type": "vampirism:parent",
  "parent": "<task-id>"
}
| Field | Type | Description | 
|---|---|---|
| parent | ResourceLocation | the id of the task that needs to be completed before this task can be started | 
Example
{
  "requirements": {
    "requirements": [
      {
        "type": "vampirism:stat",
        "amount": 6,
        "description": {
          "translate": "stat.vampirism.capture_village"
        },
        "id": "vampirism:capture_village",
        "stat": "vampirism:capture_village"
      },
      {
        "type": "vampirism:item",
        "description": {
          "translate": "item.minecraft.gold_ingot"
        },
        "id": "minecraft:gold_ingot",
        "item": {
          "Count": 64,
          "id": "minecraft:gold_ingot"
        }
      },
      {
        "type": "vampirism:entity_type",
        "amount": 100,
        "description": {
          "translate": "entity_tag.vampirism.vampire"
        },
        "entityType": "vampirism:vampire",
        "id": "vampirism:vampire"
      }
    ]
  },
  "rewards": {
    "type": "vampirism:lord_level",
    "description": {
      "translate": "task_reward.vampirism.lord_level_reward",
      "with": [
        "5"
      ]
    },
    "targetLevel": 5
  },
  "title": {
    "translate": "task.vampirism.hunter_lord5"
  },
  "unlocker": [
    {
      "type": "vampirism:lord_level",
      "exact": true,
      "reqLordLevel": 4
    }
  ]
}